let getElementsByTagName = e => document.getElementsByTagName(e);
let query = location.search;
let badVisit;
let p = getElementsByTagName("span");
if (query) {

    let text = query.substring(1).split("&");
    let type = { t: 1, d: 2 };
    text.forEach(str => {

        let index = str.indexOf('=');
        (p[type[str.substring(0, index)]] || {}).innerHTML = decodeURIComponent(str.substring(index + 1));
        global.a = type[str.substring(0, index)];

    });

} else {
    getElementsByTagName("p")[0].innerHTML = "您不可直接访问此页面";
    getElementsByTagName("p")[1].innerHTML = "";
}